<template>
    <div class="doctorregister">
        <div class="container ">
            <h2 class="titleName">{{orgName}}</h2>
            <div class="main">
                <div class="title">开展的临床科室</div>
                <div class="fuwu">
                    <div class="xsfw">
                        <!--第一行-->
                        <div class="select_wufu" ref="all">
                            <template>
                                <div v-for="(item,index) of departmentList" :key='index' style="font-size: 14px;">
                                    <span>{{ item.dictName }}</span>
                                </div>
                            </template>
                        </div>
                    </div>
                </div>
            </div>
            <div class="btn">
                <Button @click="back">
                    <i class = "iconfont icon-butongyi" style="font-size:14px;margin-right:5px"></i>返回
                </Button>
            </div>
        </div> 
    </div>
</template>
<script>
// 医生注册信息
import cookie from "@/utils/cookie.js";
import api from "@/api/commonApi";
export default {
    data() {
        return {
            tableLoading: false,
            hospitalId: null,
            orgName: null,
            departmentList: [],
            pageNo: '',
        };
    },
    created() {
        this.pageNo = this.$route.query.pageNo
        this.hospitalId = this.$route.query.hospitalId
        this.orgName = this.$route.query.orgName
        let breadList = [
        { path: "/index", title: "首页" },
        {
            path: "/index/maintain/indexManagement/index",
            title: "索引管理"
        },
        {
            path: "/index/supervision/qualificationApply/list",
            title: "资质申请"
        }
        ];
        this.$emit("changeBreadList", breadList);
    },
    mounted() {
        this.getDept();
    },
    methods: {
        // 获取页面数据
        getDept() {
            let params = {};
            params.hospitalId = this.hospitalId ? this.hospitalId : null;
            this.tableLoading = true;
            this.$axios.post(api.findSuperviseDeptList, params).then(res => {
                if (res.data.code) {
                    let ret = res.data.object;
                    console.log(ret)
                    if(ret){       
                        this.departmentList = ret;
                    } else {
                        this.departmentList = []
                    }
                } else {
                    this.$Message.info(res.data.message);
                }
                this.tableLoading = false;
            }).catch(() => {
                this.tableLoading = false;
            });
        },
        //返回
        back() {
            this.functionJS.queryNavgationTo(
                this,
                "/index/supervision/treatmentSupervision/list",
                {
                    pageNo: this.pageNo,
                    hospitalId: this.hospitalId,
                    orgName: this.orgName,
                }
            );
        },
    },  
};
</script>
<style lang="less" scoped>
.doctorregister {
    padding: 10px;
    width: 100%;
    background: #ffffff;
    box-sizing: border-box;
    margin: 0 auto;
    .container {
        width: 100%;
        margin: 0 auto;
        .main {
            width: 98%;
            margin: 20px auto;
            margin-left: 1%;
            margin-bottom: 20px;
            padding-bottom: 20px;
            border: 1px solid #f0f0f0;
            box-shadow: 0 4px 3px #ebedf8;
            border-radius: 5px;
            .title {
                font-size: 20px;
                padding-left: 15px;
                margin-bottom: 20px;
                color: #333;
                height: 40px;
                line-height: 40px;
                background: #ebedf8;         
            }
            .fuwu {
                width: calc(100%);
                margin: 0 auto;
                display: flex;
                flex-direction: column;
                border-bottom: 1px solid rgb(242, 242, 242);
                .xsfw {
                    margin: 0;
                    .select_wufu {
                        margin: 0 30px;
                        display: flex;
                        flex-direction: row;
                        padding-left: 20px;
                        align-items: center;
                        flex-wrap: wrap;
                        div {
                            width: 13%;
                            margin: 10px 20px;
                            display: flex;
                            flex-direction: row;
                            align-items: center;
                            font-size: 14px !important;
                            font-weight: 550;
                            input {
                                outline: none;
                                border: none;
                            }
                        }
                    }
                }
            }
        }
        .titleName {
            text-align: center;
        }
        .btn {
            text-align: center;
        }
    }
}
</style>